<?php
/*
 * @project CreativeFramework
 * @version <#RELEASE_VERSION#>
 * @license GNU Lesser General Public License
 * @author Jimmie Lin
 */

class Views {
	public function Load($view, $data = array()) {
		global $Smarty, $Debug;
		$path = APPLICATION_PATH.APP_TYPE."/".APPLICATION."/views/{$view}.php";
		if(file_exists($path)) {
			$Viewdata = $data;
			$Debug->writeLog("Initialized View {$view}.", "Core");
			require_once($path);
			return true;
		}
		else {
			echo "<b>CF^4 Error:</b> Failed to Load View {$view}. Path Dump {$path}";
			return false;
		}
	}
}
